//
//  CZCustomTextField.swift
//  GZWeibo007
//
//  Created by 颜祥 on 15/12/26.
//  Copyright © 2015年 Apple. All rights reserved.
//

import UIKit


class CZCustomTextField: UITextView
{
    // 重置编辑区域
//    override func selectionRectsForRange(range: UITextRange) -> [AnyObject] {
//        return [NSMakeRange(0, 0)]
//    }
//    
    override init(frame: CGRect, textContainer: NSTextContainer?) {
        super.init(frame: frame, textContainer: textContainer)
        
        // 准备UI
        prepareUI()
        
    }

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    func prepareUI()
    {
        addSubview(placeHodler)
        
        addConstraint(NSLayoutConstraint(item: placeHodler, attribute: NSLayoutAttribute.Top, relatedBy: NSLayoutRelation.Equal, toItem: self, attribute: NSLayoutAttribute.Top, multiplier: 1, constant: 0))
        addConstraint(NSLayoutConstraint(item: placeHodler, attribute: NSLayoutAttribute.Left, relatedBy: NSLayoutRelation.Equal, toItem: self, attribute: NSLayoutAttribute.Left, multiplier: 1, constant: 0))
        addConstraint(NSLayoutConstraint(item: placeHodler, attribute: NSLayoutAttribute.Width, relatedBy: NSLayoutRelation.Equal, toItem: nil, attribute: NSLayoutAttribute.NotAnAttribute, multiplier: 1, constant: 80))
        addConstraint(NSLayoutConstraint(item: placeHodler, attribute: NSLayoutAttribute.Height, relatedBy: NSLayoutRelation.Equal, toItem: nil, attribute: NSLayoutAttribute.NotAnAttribute, multiplier: 1, constant: 20))
    }
    
    lazy var placeHodler: UILabel = UILabel()
        
     
//    private lazy var placeHodler: UILabel = {
//        let placeHodler = UILabel()
//        
//        placeHodler.text = "分享你的心得"
//        placeHodler.font = UIFont.systemFontOfSize(15)
//        return placeHodler
//    }()
    
    
}
